<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件
//curl get
function http_get_curl($type,$url,$cookies){
	 if (empty($url)) {
		return false;
	 }
	 $ch = curl_init();//初始化curl
	 curl_setopt($ch, CURLOPT_URL,$url);//抓取指定网页
	 curl_setopt($ch, CURLOPT_HEADER, 0);//设置header
	 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//要求结果为字符串且输出到屏幕上
	 if($type){  //判断请求协议http或https
	 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 跳过证书检查
	 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);  // 从证书中检查SSL加密算法是否存在
	 }
	 curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); // 模拟用户使用的浏览器
	 if(!empty($cookie))curl_setopt($ch,CURLOPT_COOKIE,$cookie);  //设置cookie
	 $data = curl_exec($ch);//运行curl
	 curl_close($ch);
	 return $data;
}

//curl _post
function http_post_curl(){
	
}